﻿/********************************************************************************************************
  1. 스토어드명		: SP_STANDARDCODE_MANAGEMENT_CUD
  2. 목적 & 기능		: Standard Group Code 추가/수정/삭제
  3. 생성일자		: 2014.06.30
  4. 생성자 			: 조범준
  5. Used DB Name	: DB_EDUC
  6. Used DB Table	:
						CREATE	- STDCODE_GROUP a
						UPDATE	- STDCODE_GROUP a
  7. 실행			:
********************************************************************************************************/
----------------------------------------------------------------------------------------------------------
CREATE OR REPLACE PROCEDURE SP_STANDARDCODE_MANAGEMENT_CUD
(
	iJOBMODE		IN VARCHAR2,
	iOBJECTID		IN NUMBER,
	iNAME			IN VARCHAR2,			
	iDESCRIPTION	IN VARCHAR2,
	iSTATE			IN NUMBER,
	iFIXED			IN NUMBER
)
IS
BEGIN
----------------------------------------------------------------------------------------------------------
-- 작업구분
----------------------------------------------------------------------------------------------------------
    IF iJOBMODE = 'CREATE_GROUPCODE' THEN
        GOTO CREATE_GROUPCODE;
    ELSIF iJOBMODE = 'UPDATE_GROUPCODE' THEN
        GOTO UPDATE_GROUPCODE;
    END IF;
----------------------------------------------------------------------------------------------------------
-- Standarad Group Code 추가
----------------------------------------------------------------------------------------------------------
<<CREATE_GROUPCODE>>
	INSERT INTO	STDCODE_GROUP (OBJECTID, NAME, DESCRIPTION, STATE, FIXED, CREATE_DATE)
	VALUES (SEQ_STDCODE_GROUP.NEXTVAL, iNAME, iDESCRIPTION, iSTATE, iFIXED, SYSDATE);
	RETURN;
----------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------
-- Standarad Group Code 수정
----------------------------------------------------------------------------------------------------------
<<UPDATE_GROUPCODE>>
	UPDATE	STDCODE_GROUP A
	SET		A.NAME	=	iNAME,
			A.DESCRIPTION	=	iDESCRIPTION,
			A.STATE	=	iSTATE,
			A.FIXED	= iFIXED,
			A.MODIFY_DATE	=	SYSDATE
	WHERE A.OBJECTID		= iOBJECTID;
	RETURN;
----------------------------------------------------------------------------------------------------------
END SP_STANDARDCODE_MANAGEMENT_CUD;
